

class pipelineJobsProjects():

    def jobsList(project):
        # list jobs for the project page =1 not 0 ,per_page default 20  or more
        jobs = project.jobs.list(page=1, per_page=20)

        return jobs

    def jobsOneSingle(project, jobid):
        try:
            # a single job id project
            singlejob = project.jobs.get(jobid)
            return singlejob
        except Exception as e:
            return "job id is not exist", e

    def jobsPaly(project, jobid):
      # get a single job
        getsinglejob = project.jobs.get(jobid).attributes
      # obain runner not none retry job
        if getsinglejob['runner'] != None:
            lazyjob = project.jobs.get(jobid, lazy=True)
            lazyjob.retry()
        else:
            print("None")
